"""
created  by  hzwlxy  at 2018/7/3 11:25
__author__: 西瓜哥
__QQ__ : 120235331
__Note__: ORM 模型和表映射
"""
from app.ext import login_manager

__author__ = '西瓜哥'

from .role import Role
from .permission import Permission
from .admin import Admin
from .user import User
from .group import Group
from .menu import Menu


@login_manager.user_loader
def load_user(id, endpoint='user'):
    if endpoint == 'admin':
        return Admin.query.get(id)
    else:
        return User.query.get(id)
